home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / prog_c / afpc.zip / AFPC.DOC next >
Text File  |  1994-06-16  |  3KB  |  91 lines

  1. AFPC v1.10 - the Automatic Function Prototyper for C            June 7/94
  2. ------------------------------------------------------------------------------
  3.  
  4. What is AFPC ?
  5. --------------
  6.  
  7. AFPC is a program that takes care of that annoying (but necessary) facet of
  8. C Language programming. Whenever you create a function, it is necessary also
  9. to declare it's prototype. If you're like me, then the fuction's paramaters
  10. constantly change. And this is extremely annoying 'cause you have to go find
  11. the prototype and change it also.
  12.  
  13. What does it do ?
  14. -----------------
  15.  
  16.         AFPC alleviates this problem. Every time it is called, it scans the 
  17. C source file and finds all functions. It then takes the function names and
  18. writes the corresponding function prototypes to a header file of the same name
  19. as the C source file. 
  20.  
  21. How do you run it?
  22. ------------------
  23.  
  24. Simply type :   AFPC sourcefile(s) <Enter>
  25.  
  26. This causes the source file(s) to be scanned and header file(s) created.
  27.  
  28. eg.             AFPC test.c lib.c strings.c<Enter>
  29.  
  30. will create the header file(s) test.h, lib.h, strings.h.
  31.  
  32. Assuming that the functions :
  33.  
  34.         void    TestMe(char *a) { }
  35.         void    WatchThis(int a, FILE *b, char c) { }
  36.  
  37. were in test.c, test.h would then look like :
  38.  
  39.         void    TestMe(char *a);
  40.         void    WatchThis(int a, FILE *b, char c);
  41.  
  42. Just make sure to include the statement "#include "filename.h"" in your C
  43. source file and everything will compile fine.
  44.  
  45. C++ Support
  46. -----------
  47.  
  48.         I've implemented support for the // comment but haven't had time to
  49. learn C++ yet. I think AFPC should work fine on C++ but there's only one way
  50. to find out.
  51.  
  52. Limitations
  53. -----------
  54.  
  55.         AFPC currently doesn't support function coded like this :
  56.  
  57.         void TestMe(int, char)
  58.         int a;
  59.         char b;
  60.         {}      
  61.         
  62.         For now, you will have to code like void TestMe(int a, char b) {}
  63. if you wish to use AFPC.
  64.  
  65.         AFPC does not support the same function names defined twice in a
  66. source file. An example would be with the #ifdef and #else statements. In 
  67. C it is legal to do this :
  68.  
  69.                 #ifdef UNIX
  70.                 void TestFunction(char *) {
  71.                         printf("This is a test\n");
  72.                 }
  73.                 #else
  74.                 void TestFunction(char *, int) {
  75.                         printf("This is a test\n");
  76.                 }
  77.  
  78. but AFPC will write the function to the header file in both formats. If it is
  79. absolutely necessary to do something like this, resort to the old method (ie.
  80. the hard way).
  81.  
  82. Unfortunately...
  83. ----------------
  84.  
  85.         Time is money, and to make up for this investment I am selling this 
  86. program. Obviously, it is a real time saver as it alleviates that annoying
  87. task of defining (and redefining) function prototypes.
  88.  
  89.         Bearing this in mind, I crippled (gasp!) the program so that it only
  90. writes up to 5 functions. The commercial version will handle all your functions
  91. and it costs $25 US.